import { defineStore } from "pinia";

export const useAppStore = defineStore("App", {
  state: () => ({
    themeObj: {},
    themeColor: localStorage.getItem("themeColor") || "#36f7ff",
  }),
  actions: {
    // 设置主题色
    setThemeColor(color) {
      localStorage.setItem("themeColor", color);
      this.themeColor = color;
      this.themeObj = {
        "--default": color,
      };
    },
  },
});
